<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>业务员管理 - 销售业绩管理系统</title>
<style type="text/css">
<!--
.STYLE1 {	color: #FFFFFF;
	font-weight: bold;
	font-size: 12px;
}
.STYLE6 {font-size: 12px; }
.STYLE7 {font-size: 12px; background-color: #f5f5f5;margin:0;}
.STYLE9 {font-size: 12px; background-color: #ffffff;margin:0;}
.STYLE8 {color: #FFFFFF;font-weight: bold;font-size: 12px; background-color: #1C94C4;margin:0; }
body { 
margin:0;
}
a:link {
	color: #0066FF;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #0099FF;
}
a:hover {
	text-decoration: none;
}
a:active {
	text-decoration: none;
}
-->
</style>
<link href="../components/mmGrid/mmGrid.css" rel="stylesheet"
	type="text/css" media="all" />
<link href="../components/mmGrid/mmPaginator.css" rel="stylesheet"
	type="text/css" media="all" />
<script type="text/javascript" src="../js/jquery-1.11.1.min.js"></script>
<script type="text/javascript" src="../components/mmGrid/mmGrid.js"></script>
<script type="text/javascript" src="../components/mmGrid/mmPaginator.js"></script>
</head>
<script LANGUAGE="javascript"> 
function showView(){
window.open('SalesmanList.html','_blank','width=500,height=600,left=200,top=150,resizable=1,status=1'); 
}
function showEdit(id){
	var value = showModalDialog('SalesmanEdit.html?id=' + id ,'业务员信息修改','dialogWidth:500px;dialogHeight:600px; dialogLeft:200px;dialogTop:150px;center:yes;help:yes;resizable:yes;status:yes'); 
	if(value == "1")
		ywyGrid.load();
}

function showGroupImage(id){
window.open('../jOrgChart/GroupImage.html?id=' + id,'_blank','width=1000,height=800,left=200,top=150,resizable=1,status=1'); 
}

</script>

<body margin=0>

<table width="101%" bgcolor="#FFFFFF"  border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td height="24" class="STYLE7">
      <table width="100%" border="0" cellspacing="2">
        <tr>
          <td height="25" class="STYLE7">业务员管理 &gt;业务员信息浏览</td>
        </tr>
        <tr>
          <td class="STYLE9">业务员名称：
            <input id="ywyname" name="textfield2" type="text" size="10" />
<input type="button" name="Submit3" value="查询" onclick="search()" /></td>
        </tr>
      </table>     </td>
  </tr>
 
  <tr>
    <table id="ywyTable"  style="font-size:12px !important;">
			<tr >
				<th rowspan="" colspan=""></th>
			</tr>
	</table>
	<div id="ywypg" style="text-align:right;margin-right:10px;font-size:12px;"></div>
  </tr>
</table>

</body>
</html>

<script>
var ywyCol = [
				{title:'业务员编号',align: 'center', name:'SalesmanNumber',width:50},
                {title:'业务员名称',align: 'center', name:'SalesmanName',width:50},
					{title:'地址',align: 'center', name:'SalesmanAddress',width:100},
					{title:'创建时间',align: 'center', name:'CreateDate',width:60},
					{title:'操作',name:'',width:200,align:'center',lockWidth:true,lockDisplay: true,renderer: function(val){
                     return '<button type="button" class="edit">修改</button><button type="button" class="del">删除</button><button type="button" class="show">结构图</button>';
                 }
					}
           ];
	var ywyGrid = $('#ywyTable').mmGrid({
     height: 300
	 ,width:'99%'
	 ,indexCol: true
     , cols: ywyCol
     , url: '../ywy/ywylist'
     , method: 'get'
     , root: 'data'
     , multiSelect: false
     , checkCol: false
     , fullWidthRows: true
     , nowrap: true
     , plugins: [
         $('#ywypg').mmPaginator({limitList: [10, 20, 30,50]})
     ]
 });

	ywyGrid.on('cellSelected', function(e, item, rowIndex, colIndex){
     if($(e.target).is('.edit')){
         e.stopPropagation();
         showEdit(item.ID);
     }
     if($(e.target).is('.del')){
         e.stopPropagation();
         $.post("../ywy/delete",{id:item.ID},function(json){
         	if(json)
         		{
         		alert("删除成功");
         		ywyGrid.load();
         		}
         });
     }
     if($(e.target).is('.show')){
    	 e.stopPropagation();
    	 showGroupImage(item.ID);
    	 }
 });
	function search()
	{
		ywyGrid.load({ywyname:$("#ywyname").val()});
		
	}
</script>